home *** CD-ROM | disk | FTP | other *** search
/ Champak 106 / Vol 106.iso / games / rain_for.swf / scripts / __Packages / smashing / Phys.as < prev    next >
Encoding:
Text File  |  2010-04-12  |  758 b   |  29 lines

  1. class smashing.Phys
  2. {
  3.    static var pUp;
  4.    static var gr = 700;
  5.    static var fr = 0.75;
  6.    static var bf = 0.7;
  7.    static var height = 370;
  8.    static var width = 600;
  9.    static var TWOPI = 6.283185307179586;
  10.    function Phys()
  11.    {
  12.    }
  13.    static function drag(f, t)
  14.    {
  15.       return f * Math.pow(t,smashing.Phys.fr);
  16.    }
  17.    static function bounce(v, n)
  18.    {
  19.       var _loc2_ = v.reverse();
  20.       var _loc1_ = n.multiply(n.dot(_loc2_));
  21.       v.x = _loc1_.x * smashing.Phys.bf + (_loc1_.x - _loc2_.x);
  22.       v.y = _loc1_.y * smashing.Phys.bf + (_loc1_.y - _loc2_.y);
  23.    }
  24.    static function get up()
  25.    {
  26.       return smashing.Phys.pUp != undefined ? smashing.Phys.pUp : (smashing.Phys.pUp = new smashing.Point(0,-1));
  27.    }
  28. }
  29.